import Vue from 'vue'
import App from './App.vue'

// 导入组件
import Index from "./views/Index.vue"
import Sort from "./views/Sort.vue"
import Order from "./views/Order.vue"
import My from "./views/My.vue"

Vue.config.productionTip = false

// 1.导入路由
import vueRouter from "vue-router"
// 2.使用插件
Vue.use(vueRouter)
// 3.配置规则
let routes = [{
  path: "/",
  component: Index
}, {
  path: "/index",
  component: Index
}, {
  path: "/sort",
  component: Sort
}, {
  path: "/order",
  component: Order
}, {
  path: "/my",
  component: My
}]

// 4.
let router = new vueRouter({
  routes
})

// 5.
new Vue({
  render: h => h(App),
  router
}).$mount('#app')